<template>
	
	<view>
		<view class="frieds" v-for="(item,indexlist) in item" :key="indexlist">
			<image src="../../static/icon4.png" mode="scaleToFill"></image>
			<view style="display: flex;justify-content: space-between;width: 84%;">
				<text>
					<text class="users" >{{item.name}}</text>
				</text>
				<view style="color: #007AFF;" @click="entry( item.src)">学习</view>
			</view>
		</view>
		<view class="title">当打开错误时，你可选择WPS相似软件。学习内容无更新，可下拉更新</view>
		<ourLoading v-show="show_f" isFullScreen active text="正在加载中!!!" />
	</view>

</template>

<script>

	export default {
		data() {
			return {
				show_f:false,
				save: String,
				item:[
					{name:"Unicode编码算法",src:'https://ani-qi.gitee.io/vue1.0/Unicode.js'},
					{name:"Base64算法",src:'https://ani-qi.gitee.io/vue1.0/base64.js'},
					{name:"MD5算法",src:'https://ani-qi.gitee.io/vue1.0/MD5.js'},
					{name:"AES算法",src:'https://ani-qi.gitee.io/vue1.0/AES.js'},
					{name:"Utf8算法",src:'https://ani-qi.gitee.io/vue1.0/utf8.js'}
				],
				src_down:''
			};
		},
		 onPullDownRefresh() {
		        setTimeout(function () {
					uni.showToast({
						title: "刷新完成",
						icon: "none",
						duration: 2000
					})
		            uni.stopPullDownRefresh();
		        }, 1000);
		    },
		methods: {
			entry(src) {
				this.show_f=true
				this.src_down=src
				const downloadTask = uni.downloadFile({
					url: this.src_down,
					success: (res) => {
						this.post_show = false
						var filePath = res.tempFilePath;
						uni.openDocument({
							filePath: filePath
						});
							this.show_f=false
					}
				});
			},
		}
	}
</script>

<style lang="less" scoped>
	.contenter {
		width: 96%;
		// margin: 2%;
		margin: 2% auto;
	}
.title {
		font-size: 36rpx;
		color: #8f8f94;
		text-align: center;
		margin: 4%;
	}
	.frieds {
		width: 96%;
		// margin: 2%;
		margin: 0 auto;
		height: 100rpx;
		line-height: 150rpx;
		// background-color: red;
		border-bottom: 1px solid #D9D9D9;
		// padding-bottom: 8px;
		display: flex;
		align-items: center;
		justify-content: space-between;

		image {
			width: 80rpx;
			height: 80rpx;
			border-radius: 20rpx;
		}

		view {
			.users {
				font-size: 34rpx;
				font-weight: bolder;
			}

			.time {
				font-size: 24rpx;
				color: #b0b0b0;
			}

			.crx {
				font-size: 25rpx;
				color: #b0b0b0;
			}
		}

	}
</style>
